package common.data.report
{
	import mx.rpc.events.ResultEvent;
	import mx.rpc.remoting.RemoteObject;

	/**
	 * 定位服务类
	 */
	public class StaffCheckWorkReportService extends RemoteObject
	{
		public var queryStaffsCheckWorkReportCallBack:Function;
		public var queryStaffDateDetailCallBack:Function;
		
		
		public function StaffCheckWorkReportService() {
			super("staffCheckWorkReportService");
			this.showBusyCursor = true;
			this.getOperation("queryStaffsCheckWorkReport").addEventListener(ResultEvent.RESULT,queryStaffsCheckWorkReportResult,false,0,true);
			this.getOperation("queryStaffDateDetail").addEventListener(ResultEvent.RESULT,queryStaffDateDetailResult,false,0,true);
		}
		
		public function queryStaffsCheckWorkReport(staffIds:Array,startDate:String,endDate:String):void{
			this.getOperation("queryStaffsCheckWorkReport").send(staffIds,startDate,endDate);
		}
		public function queryStaffDateDetail(staffId:String,date:String,staffName:String):void{
			this.getOperation("queryStaffDateDetail").send(staffId,date,staffName);
		}
		
		//回调根据员工ID集合获取实时定位信息
		private function queryStaffsCheckWorkReportResult(e:ResultEvent):void{
			try{
				if(queryStaffsCheckWorkReportCallBack != null){
					queryStaffsCheckWorkReportCallBack.apply(this,[e]);
				}
			}catch(error:Error){
				trace(error.getStackTrace());
			}
		}
		//回调根据员工ID集合获取实时定位信息
		private function queryStaffDateDetailResult(e:ResultEvent):void{
			try{
				if(queryStaffDateDetailCallBack != null){
					queryStaffDateDetailCallBack.apply(this,[e]);
				}
			}catch(error:Error){
				trace(error.getStackTrace());
			}
		}
	}
}	